Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Fix] Camera crash on deallocation #336

Merged
merged 1 commit into from
Dec 10, 2024
Merged

Conversation

nejcvivod
Copy link
Contributor

Deallocating the camera object after calling stopSession can sometimes produce a crash; using sync instead of async on the queue prevents this as the object is kept around until the session actually stops :)

Repro is quite simple - create a view of some kind that holds an optional reference to the camera (qrscanner in my case), calls stopCamera() and also nils the reference at the same time. This crashes the app with EXC_BAD_ACCESS on guard self.session.isRunning in Camera.swift

Applying this patch fixes the issue :)

Copy link
Collaborator

@borut-t borut-t left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👌

@borut-t borut-t added the merge label Dec 10, 2024
@nejcvivod nejcvivod merged commit e67fe98 into develop Dec 10, 2024
1 check passed
@nejcvivod nejcvivod deleted the fix/crash-camera-deallocated branch December 10, 2024 13:23
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants